﻿using AutoTest.Domain.Enums;
using SqlSugar;

namespace AutoTest.Domain.Entities
{
    /// <summary>
    /// 商品信息
    /// </summary>
	[SugarTable("t_goods", TableDescription = "商品信息")]
    public class Goods : AllBaseEntity
    {
        ///<summary>
        /// 商品主键
        ///</summary>
        [SugarColumn(IsPrimaryKey = true, ColumnName = "id", ColumnDescription = "主键Id")]
        public long Id { get; set; } = 0;

        /// <summary>
        /// 商品名称
        /// </summary>
		[SugarColumn(ColumnName = "goods_name", ColumnDescription = "商品名称")]
        public string GoodsName { get; set; } = string.Empty;
        ///<summary>
        /// 封面图
        ///</summary>
        [SugarColumn(ColumnName = "conver_img", ColumnDescription = "封面图")]
        public string ConverImg { get; set; } = string.Empty;
        /// <summary>
        /// 商品描述
        /// </summary>
        [SugarColumn(ColumnName = "goods_desc", ColumnDescription = "商品描述")]
        public string GoodsDesc { get; set; } = string.Empty;
        /// <summary>
        /// 是否已经上架
        /// </summary>
		[SugarColumn(ColumnName = "is_on_shelf", ColumnDescription = "是否已经上架")]
        public bool IsOnShelf { get; set; }
        /// <summary>
        /// 状态
        /// </summary>
        [SugarColumn(ColumnName = "status", ColumnDescription = "状态")]
        public EnumStatus Status { get; set; } = EnumStatus.Disable;
        /// <summary>
        /// 上架时间
        /// </summary>
		[SugarColumn(ColumnName = "on_shelf_time", ColumnDescription = "上架时间")]
        public DateTime? OnShelfTime { get; set; }
        /// <summary>
        /// 原价
        /// </summary>
        [SugarColumn(ColumnName = "origin_price", ColumnDescription = "原价")]
        public int OriginPrice { get; set; }
        /// <summary>
        /// 购买价
        /// </summary>
        [SugarColumn(ColumnName = "buy_price", ColumnDescription = "价格购买价")]
        public int BuyPrice {get; set; }

        /// <summary>
        /// 商品明细
        /// </summary>
        [Navigate(NavigateType.OneToMany,nameof(GoodsDetail.GoodsId))]
        public List<GoodsDetail>? Details { get; set; }
    }
}
